package com.duobaoyu.dby.supply.admin.controller.logistics;

import com.duobaoyu.dby.channel.adapter.enums.OperationTypeEnum;
import com.duobaoyu.dby.common.core.util.R;
import com.duobaoyu.dby.supply.admin.annotation.SupplySysLog;
import com.duobaoyu.dby.supply.admin.service.AdminOrderBizService;
import com.duobaoyu.dby.supply.common.biz.dto.order.OrderDeliveryDTO;
import com.duobaoyu.dby.supply.common.biz.vo.order.OrderDeliveryVO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * 物流信息
 * @Author yangyong
 * @Date 2023/10/18
 */
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin/order/logistics")
public class LogisticsController{
	private final AdminOrderBizService adminOrderBizService;

	/**
	 * 获取订单物流信息
	 * @param orderDelivery 查询条件
	 */
	@PostMapping("/list")
	@ApiOperation(value = "获取订单物流信息", notes = "获取订单物流信息")
	@SupplySysLog(value = "获取订单物流信息",operationType = OperationTypeEnum.SELECT)
	public R<List<OrderDeliveryVO>> listOrderDelivery(@Valid @RequestBody OrderDeliveryDTO orderDelivery) {
		return R.ok(adminOrderBizService.listOrderDelivery(orderDelivery));
	}
}
